import java.util.Arrays;

public class Test {
    public static int fib(int n){   // 递归斐波那契
        if(n == 1||n==2){
            return 1;
        }
        return fib(n-1)+fib(n-2);
    }
    public static void main(String[] args) {
        System.out.println(fib(3));
        //定义数组
        int[] array1 = {1,2,3,4};
        int[] array2 = new int[] {1,2,3,4};
        int[] array3 = new int[5];
        for (int i = 0; i < array1.length; i++) {
            System.out.print(array1[i]+" ");
        }
        //增强for循环
        for (int x:array1) {
            // 遍历array1 每拿一个就放x里，好处就是没用到下标
        }
        //Arrays.toString(arr) 将传入的数组，以字符串的形式输出，多加[]
        String ret = Arrays.toString(array1);
        System.out.println(ret);
    }
}
